package info.opensoaring.server.jdo;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Link;
import com.google.appengine.api.users.User;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class Club {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key id;

    @Persistent
    private String name;

    @Persistent
    private Float latitude;

    @Persistent
    private Float longitude;

    @Persistent
    private Link webUrl;

    @Persistent
    private String contact;

    @Persistent
    private User responsible;

    public Club(String name) {
	this.name = name;
    }
    
    public Club(String name, Float latitude, Float longitude, Link webUrl, String contact,
	    User responsible) {
	this.name = name;
	this.latitude = latitude;
	this.longitude = longitude;
	this.webUrl = webUrl;
	this.contact = contact;
	this.responsible = responsible;
    }
    
    public Key getKey() {
	return id;
    }

    public void setKey(Key id) {
	this.id = id;
    }

    public String getName() {
	return name;
    }

    public void setName(String name) {
	this.name = name;
    }

    public Float getLatitude() {
	return latitude;
    }

    public void setLatitude(Float latitude) {
	this.latitude = latitude;
    }

    public Float getLongitude() {
	return longitude;
    }

    public void setLongitude(Float longitude) {
	this.longitude = longitude;
    }

    public Link getWebUrl() {
	return webUrl;
    }

    public void setWebUrl(Link webUrl) {
	this.webUrl = webUrl;
    }

    public String getContact() {
	return contact;
    }

    public void setContact(String contact) {
	this.contact = contact;
    }

    public User getResponsible() {
	return responsible;
    }

    public void setResponsible(User responsible) {
	this.responsible = responsible;
    }

}
